home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of a generic input source
-
- #include "NSDLL.h"
-
- #define data(i,j) data[j+i*cols]
-
- /***************************/
- /* Activation of component */
- __declspec(dllexport) void performInput(
- DLLData *instance, // Pointer to instance data (may be NULL)
- NSFloat *data, // Pointer to the data
- int rows, // Number of rows of data
- int cols // Number of cols of data
- )
- {
- int i,j;
- for (i=0; i<rows; i++)
- for (j=0; j<cols; j++)
- data(i,j) = 0.0f; // You define your own input source.
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocInput(
- DLLData *oldInstance, // Pointer to the last instance if reallocating
- int rows, // Number of rows of data
- int cols // Number of cols of data
- )
- {
- DLLData *instance = allocDLLInstance(oldInstance);
- return instance;
- }
-
- __declspec(dllexport) void freeInput(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */